<?php

namespace App\Admin\Controllers;

//use Encore\Admin\Admin;
use Encore\Admin\Facades\Admin;
use Illuminate\Routing\Router;

class GetStudent
{
    protected $id;

    public function __construct($id)
    {
        $this->id = $id;
    }

    protected function script()
    {
        return <<<SCRIPT

$('.grid-check-row').on('click', function () {
    $router->resource('class_group', Class_groupController::class);


});

SCRIPT;
    }

    protected function render()
    {
        Admin::script($this->script());

        return "<a class='grid-check-row' data-id='{$this->id}'><i class='fa fa-eye'></i></a>";
    }

    public function __toString()
    {
        return $this->render();
    }
}